package com.social.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.social.pojo.Evaluate;
import com.social.pojo.Petition;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author zero
* @description 针对表【evaluate】的数据库操作Mapper
* @createDate 2022-12-22 15:21:21
* @Entity com.social.pojo.Evaluate
*/
public interface EvaluateDao extends BaseMapper<Evaluate> {

    @Select("select * from petition where user_id = #{user_id} and pe_status = 2 and pe_id not in (select pe_id from evaluate where user_id = #{user_id})")
    @Results(id="peMap",value = {
            @Result(id = true,column = "pe_id",property = "peId"),
            @Result(column = "pe_title",property = "peTitle"),
            @Result(column = "pe_address",property = "peAddress"),
            @Result(column = "pe_content",property = "peContent"),
            @Result(column = "creat_time",property = "creatTime"),
            @Result(column = "is_public",property = "isPublic"),
            @Result(column = "pe_status",property = "peStatus"),
            @Result(column = "filename",property = "filename"),
            @Result(column = "reply",property = "reply"),
    })
    List<Petition> findNoEvalInPe(@Param("user_id") Long userId);
}
